#ifndef PRINTERCONTROL_H
#define PRINTERCONTROL_H

#include <QObject>
#include <QMutex>
#include <QSerialPort>
#include <QSerialPortInfo>
#include <QDebug>

class PrinterControl : public QObject
{
    Q_OBJECT

public:
    static PrinterControl* getInstance();
    static PrinterControl* m_instance;
    static QMutex m_mutex;

    QSerialPort* m_Printer;

    /**
     *  打印机操作相关函数
     */
    // 设置连接参数
    void set_Connect_Parameters(QString port,
                                QString baudRate,
                                QString dataBit,
                                QString parity,
                                QString stopBit);

    // 连接扫码枪对象
    void connet_To_Device();



    Q_INVOKABLE void print_Active_WeiHuang(QString Name,
                                           QString Process1,
                                           QString Process2,
                                           QString F_UpperKnife01Ass,
                                           QString F_UpperKnife02Ass,
                                           QString B_UpperKnife01Ass,
                                           QString B_UpperKnife02Ass,
                                           QString F_UpperKnife01,
                                           QString F_UpperKnife02,
                                           QString B_UpperKnife01,
                                           QString B_UpperKnife02,
                                           QString F_LowerKnife01,
                                           QString F_LowerKnife02,
                                           QString B_LowerKnife01,
                                           QString B_LowerKnife02,
                                           QString Roller);
private:
    PrinterControl(QObject *parent = nullptr);
    ~PrinterControl();
    PrinterControl(const PrinterControl&)=delete;
    PrinterControl& operator=(const PrinterControl)=delete;

signals:
};

#endif // PRINTERCONTROL_H
